import { memberlist, membercount } from '../../request/api';

export default {
    namespaced: true,
    state: {
        memberList: [],
        memberCount: 0
    },
    getters: {
    },
    mutations: {
        changeMemberList(state, data) {
            state.memberList = data;
        },
        changeMemberCount(state, data) {
            state.memberCount = data;
        }
    },
    actions: {
        getMemberList(context, params) {
            memberlist(params).then(res => {
                if (res.code == 200) {
                    context.commit('changeMemberList', res.list);
                }
            })
        },
        getMemberCount(context) {
            membercount().then(res => {
                if (res.code == 200) {
                    context.commit('changeMemberCount', res.list[0].total)
                }
            })
        }
    },
    modules: {
    }
}